package cn.wolfcode.luowowo.article.service.impl;

import cn.wolfcode.luowowo.article.domain.Region;
import cn.wolfcode.luowowo.article.domain.Route;
import cn.wolfcode.luowowo.article.domain.Theme;
import cn.wolfcode.luowowo.article.mapper.ThemeMapper;
import cn.wolfcode.luowowo.article.service.IThemeService;
import com.alibaba.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

@Service
public class ThemeServiceImpl implements IThemeService {
    @Autowired
    private ThemeMapper themeMapper;

    @Override
    public void saveOrUpdate(Theme theme) {
        if (theme.getId()==null){
            themeMapper.insert(theme);
            return;
        }
        themeMapper.updateByPrimaryKey(theme);
    }

    @Override
    public Theme get(Long id) {
        return themeMapper.selectByPrimaryKey(id);
    }
}
